package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.WarnMapper;
import com.jsb.model.Warn;
import com.jsb.model.WarnExample;

@Service
public class WarnService{
	
	@Resource
	private WarnMapper warnMapper;
	
	public void addWarn(Warn warn) {
		warnMapper.insertSelective(warn);
	}
	
	public void delWarnByUuid(String uuid) {
		warnMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateWarn(Warn warn) {
		warnMapper.updateByPrimaryKeySelective(warn);
	}
	
	public void updateWarnByExample(Warn warn,WarnExample warnExample){
	    warnMapper.updateByExampleSelective(warn,warnExample);
	}
	
	public Warn getWarnByUuid(String uuid) {
		return warnMapper.selectByPrimaryKey(uuid);
	}
	
	public List<Warn> getPageWarn(WarnExample warnExample) {
		return warnMapper.selectPage(warnExample);
	}
	
	public int countWarn(WarnExample warnExample) {
		return warnMapper.countByExample(warnExample);
	}
	
	public List<Warn> selectByExample(WarnExample example){
	    return warnMapper.selectByExample(example);
	}
}
